//
//  TestPageControll.m
//  MKUITestApp
//
//  Created by 苏尚进 on 2022/10/13.
//  Copyright © 2022 moon. All rights reserved.
//

#import "TestPageControll.h"

#import "TestGridPageTableViewCell.h"
#import "Menu.h"
#import "TestCollectionPageFlowTableViewCell_1.h"
#import "TestCollectionPageFlowTableViewCell_2.h"
#import "TestCollectionPageFlowTableViewCell_3.h"
#import "TestCollectionPageFlowTableViewCell_4.h"
#import "TestCollectionPageFlowTableViewCell_5.h"
#import "TestCollectionPageFlowTableViewCell_6.h"
#import "TestCollectionPageFlowTableViewCell_7.h"
#import "TestCollectionPageFlowTableViewCell_8.h"
@interface TestPageControll ()

@end

@implementation TestPageControll
+ (MKTFuncItem *)funcItem{
    return [MKTFuncItem funcWithName:@"PageControl" viewControllerClass:self];
}
- (void)viewDidLoad{
    [super viewDidLoad];
    self.tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine;
    [self __reloadData];

}
- (void)__reloadData{
    [self.model removeAllSectionModels];
    
    {
        MKUITableViewCellModel *cm = [MKUITableViewCellModel modelWithValue:[Menu sharedMenusWithCount:20 haveAddMenu:NO] cellClass:[TestGridPageTableViewCell class]];
        [self.model addCellModel:cm];
    }
    {
        MKUITableViewCellModel *cm = [MKUITableViewCellModel modelWithValue:[Menu sharedMenusWithCount:20 haveAddMenu:NO] cellClass:[TestGridPageTableViewCell_1 class]];
        [self.model addCellModel:cm];
    }
    
    {
        MKUITableViewCellModel *cm = [MKUITableViewCellModel modelWithValue:[Menu sharedMenusWithCount:20 haveAddMenu:NO] cellClass:[TestGridPageTableViewCell_2 class]];
        [self.model addCellModel:cm];
    }
    {
        MKUITableViewCellModel *cm = [MKUITableViewCellModel modelWithValue:[Menu sharedMenusWithCount:5 haveAddMenu:NO] cellClass:[TestGridPageTableViewCell_3 class]];
        [self.model addCellModel:cm];
    }
    {
        MKUITableViewCellModel *cm = [MKUITableViewCellModel modelWithValue:[Menu sharedMenusWithCount:5 haveAddMenu:NO] cellClass:[TestGridPageTableViewCell_3 class]];
        [self.model addCellModel:cm];
    }
    {
        MKUITableViewCellModel *cm = [MKUITableViewCellModel modelWithValue:[Menu sharedMenusWithCount:1000 haveAddMenu:NO] cellClass:[TestGridPageTableViewCell_3 class]];
        [self.model addCellModel:cm];
    }
    {
        MKUITableViewCellModel *cm = [MKUITableViewCellModel modelWithValue:[Menu sharedMenusWithCount:5 haveAddMenu:NO] cellClass:[TestGridPageTableViewCell_4 class]];
        cm[@"hidesForSinglePage"] = @(NO);
        [self.model addCellModel:cm];
    }
    {
        MKUITableViewCellModel *cm = [MKUITableViewCellModel modelWithValue:[Menu sharedMenusWithCount:5 haveAddMenu:NO] cellClass:[TestGridPageTableViewCell_5 class]];
        cm[@"hidesForSinglePage"] = @(NO);
        [self.model addCellModel:cm];
    }
    
    {
        MKUITableViewCellModel *cm = [MKUITableViewCellModel modelWithValue:[Menu sharedMenusWithCount:0 haveAddMenu:NO] cellClass:[TestGridPageTableViewCell_1 class]];
        [self.model addCellModel:cm];
    }
    {
        MKUITableViewCellModel *cm = [MKUITableViewCellModel modelWithValue:[Menu sharedMenusWithCount:3 haveAddMenu:NO] cellClass:[TestGridPageTableViewCell_1 class]];
        [self.model addCellModel:cm];
    }
    
    [self.model reloadTableViewData];
}

@end
